package cn.csq.design.behavioral.observer;

/**
 * @author csq
 * @version 1.0.0
 * @ClassName Main.java
 * @Description TODO
 * @createTime 2022年02月12日 15:51:00
 */
public class Main {
    public static void main(String[] args) {

        //目标对象
        ConcreteSubject subject = new ConcreteSubject();

        //观察者
        ConcreteObserver concreteObserverA = new ConcreteObserver("A");
        ConcreteObserver concreteObserverB = new ConcreteObserver("B");

        //添加
        subject.attach(concreteObserverA);
        subject.attach(concreteObserverB);

        //通知
        subject.notifyObserver();




    }
}
